<?php
$name = system_controller_front::getInstance()->getRequest()->getActionName();
$_o = system_controller_front::getInstance()->getRequest()->getParam('o');
$_type = system_controller_front::getInstance()->getRequest()->getQuery('device');
?>
<div class="body tabs">
	<form action="<?php echo $this->url('resource/advertise/list');?>" method="get">
	<?php echo $this->form()->hidden('order', $this->order);?>
	<?php echo $this->form()->hidden('sort', $this->sort);?>
	<ul class="list">
		<li<?php if($name=='list') echo ' class="current"'; ?>><a href="<?php echo $this->url('resource/advertise/index');?>"><?php echo $this->language('ALL List');?><?php if($name=='list') echo ' »'; ?></a></li>
		<?php if($this->row && $this->row->getId()) { ?>
		<li<?php if($name=='edit') echo ' class="current"'; ?>>
			<a href="<?php echo $this->url('resource/advertise/edit', array('id' => $this->row->getId()));?>"><?php echo $this->language('Edit');?><?php if($name=='edit') echo ' »'; ?></a>
		</li>
		<li<?php if($name=='item' && $_o != 'addnew') echo ' class="current"'; ?>>
			<a href="<?php echo $this->url('resource/advertise/item', array('id' => $this->row->getId()));?>"><?php echo $this->language('Item');?><?php if($name=='item') echo ' »'; ?></a>
		</li>
		<?php if($name=='item') { ?>
		<li<?php if($name=='item' && $_o == 'addnew') echo ' class="current"'; ?>>
			<a href="<?php echo $this->url('resource/advertise/item', array('id' => $this->row->getId(), 'o' => 'addnew'));?>"><?php echo $this->language('New Item');?><?php if($name=='item' && $_o == 'addnew') echo ' »'; ?></a>
		</li>
		<?php } ?>
		<?php } else { ?>
		<li<?php if($name=='addnew') echo ' class="current"'; ?>>
			<a href="<?php echo $this->url('resource/advertise/addnew');?>"><?php echo $this->language('Create');?><?php if($name=='addnew') echo ' »'; ?></a>
		</li>
		<?php } ?>
		<li class="rs"><span><?php 
			echo '<select name="device"><option value="">==DEVICE==</option>';
			foreach(new system_setting_client() AS $client) {
				$_clientName = ucfirst(strtolower($client->getKey()));
				echo '<option value="' . $_clientName . '"' . (strtoupper($_type) == $client->getKey() ? ' selected="selected"' : '') . '>';
				echo '» ' . $_clientName;
				echo '</option>';
			}
			echo '</select>';
		?></span>
		<span><button type="submit" value="Search" class="small">Search</button></span>
		</li>
	</ul>
	<div class="clearfix"></div>
	</form>
</div>
